package com.gs.spring.core.aop;

import javax.sql.DataSource;

public class SimpleCache implements Cache {
	
	int cacheSize;
	DataSource dataSource;
	String beanName;
	
	public void setCacheSize(int size) {
		this.cacheSize = size;
	}

	public void setDataSource(DataSource ds) {
		System.out.println("Setting dataSource..");
		if(ds==null){
			System.out.println("Data source is null so throw runtime exception");
			throw new ExecutionFailedException("Data Source cannot be null.");
		}
		this.dataSource = ds;
	}

	public void setBeanName(String beanName) {
		this.beanName = beanName;
	}

	public int getCacheSize() {
		return cacheSize;
	}

	public DataSource getDataSource() {
		return dataSource;
	}

	public String getBeanName() {
		return beanName;
	}

}
